pkgname=streamsetsrpm
pkgver=3.3.0
pkgrel=1
arch=('aarch64' 'x86_64')
url="http://www..com"
license=('GPLv2')
source=()
md5sums=()

prepare()
{
        :
}

build()
{
        :
}

package()
{
        # package jdk
        wget https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u222-b10/OpenJDK8U-jdk_aarch64_linux_hotspot_8u222b10.tar.gz
        mkdir "${pkgdir}/bigdata"
        # mkdir -p "${pkgdir}/usr/local/"
        # tar -xzf "${srcdir}/OpenJDK8U-jdk_aarch64_linux_hotspot_8u222b10.tar.gz" -C "${pkgdir}/usr/local/"
        # mv "${pkgdir}/usr/local/jdk8u222-b10" "${pkgdir}/java"
        mv "${srcdir}/OpenJDK8U-jdk_aarch64_linux_hotspot_8u222b10.tar.gz" "${pkgdir}/bigdata/"

        # package mysql
        # wget https://obs.cn-north-4.myhuaweicloud.com/obs-mirror-ftp4/database/mysql-5.7.27-aarch64.tar.gz
        # mysql_home="${pkgdir}/usr/local"
        # mkdir -p "${mysql_home}"
        # tar -xvf "${srcdir}/mysql-5.7.27-aarch64.tar.gz" -C "${mysql_home}"
        # mv "${srcdir}/mysql-5.7.27-aarch64.tar.gz" "${pkgdir}/bigdata/"

        # package hadoop
        wget https://archive.apache.org/dist/hadoop/common/hadoop-2.7.3/hadoop-2.7.3.tar.gz
        # hadoop_home="${pkgdir}/usr/local"
        # mkdir -p "${hadoop_home}"
        # tar -zxvf "${srcdir}/hadoop-2.7.3.tar.gz" -C "${hadoop_home}"
        mv "${srcdir}/hadoop-2.7.3.tar.gz" "${pkgdir}/bigdata/"

        # package mysqk-connector
        wget https://downloads.mysql.com/archives/get/p/3/file/mysql-connector-java-5.1.40.tar.gz
        mv "${srcdir}/mysql-connector-java-5.1.40.tar.gz" "${pkgdir}/bigdata/"
        # package zookeeper
        wget http://archive.apache.org/dist/zookeeper/zookeeper-3.5.9/apache-zookeeper-3.5.9-bin.tar.gz
        # zookeeper_home="${pkgdir}/usr/local"
        # mkdir -p "${zookeeper_home}"
        # tar -zxvf "${srcdir}/apache-zookeeper-3.5.9-bin.tar.gz" -C "${zookeeper_home}"
        mv "${srcdir}/apache-zookeeper-3.5.9-bin.tar.gz" "${pkgdir}/bigdata/"

        # package kafka
        wget https://archive.apache.org/dist/kafka/2.2.2/kafka_2.11-2.2.2.tgz
        # kafka_home="${pkgdir}/usr/local"
        # mkdir -p "${kafka_home}"
        # tar -zxvf "${srcdir}/kafka_2.11-2.2.2.tgz" -C "${kafka_home}"
        mv "${srcdir}/kafka_2.11-2.2.2.tgz" "${pkgdir}/bigdata/"

        # package hive
        wget https://archive.apache.org/dist/hive/hive-2.3.5/apache-hive-2.3.5-bin.tar.gz
        # hive_home=="${pkgdir}/usr/local"
        # mkdir -p "${hive_home}"
        ## tar -zxvf "${srcdir}/apache-hive-2.3.5-bin.tar.gz" -C "${hive_home}"
        mv "${srcdir}/apache-hive-2.3.5-bin.tar.gz" "${pkgdir}/bigdata/"

        # package streamsets
        wget https://archives.streamsets.com/datacollector/3.3.0/tarball/streamsets-datacollector-core-3.3.0.tgz
        # streamsets_home="${pkgdir}/usr/local"
        # mkdir -p "${streamsets_home}"
        # tar -zxvf "${srcdir}/streamsets-datacollector-core-3.3.0.tgz" -C "${streamsets_home}"
        mv "${srcdir}/streamsets-datacollector-core-3.3.0.tgz" "${pkgdir}/bigdata/"
}